package com.zdpx.pxframework.system.api.api;


import com.zdpx.pxframework.core.constant.SecurityConstant;
import com.zdpx.pxframework.core.constant.ServiceNameConstant;
import com.zdpx.pxframework.core.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Set;

/**
 * 远程调用菜单接口
 *
 * @Description:
 * @Author: Cheng XiaoXiao
 * @Date: 2022-04-04 17:45
 */
@FeignClient(value = ServiceNameConstant.SYSTEM_SERVICE, url = "${px.open-feign.system-url}")
public interface RemoteMenuInfoService {
    /**
     * 根据用户ID获取拥有的权限标识列表
     *
     * @param userId 用户ID
     * @param source 来源标识
     * @return 菜单标识列表
     */
    @GetMapping("/menu-info/menu/keys/user/{userId}")
    public Result<Set<String>> getMenuKeysByUserId(@PathVariable("userId") String userId, @RequestHeader(SecurityConstant.FROM_SOURCE) String source);
}
